package com.uam.core.scheduler;

import com.uam.core.entity.model.SectorStatModel;
import com.uam.core.vo.SectorIndexVo;
import io.swagger.models.auth.In;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class PointInfoScheduler {
    /**
     * 每个任务对应的时间
     */
    private static ConcurrentHashMap<Integer,PointInfoDo> pointInfoSchedulerMap = new ConcurrentHashMap<>();

    /**
     * 长沙市每个区域的信息
     */
    public static List<SectorIndexVo> dataSectorIndex = new ArrayList<>(16);

    /**
     * 信号强度
     */
    public static List<Map<String, Object>> signalStrength = new ArrayList<>(1024);

    public static Map<String, SectorStatModel> sectorStatModelMap = new ConcurrentHashMap<>();

    public static PointInfoDo getPointInfoDo(Integer taskId){

        return pointInfoSchedulerMap.get(taskId);
    }
    public static void setPointInfoDo(Integer key,PointInfoDo pointInfoDo){
        pointInfoSchedulerMap.put(key, pointInfoDo);
    }

    public static void deletePointInfoDo(Integer key){
        pointInfoSchedulerMap.remove(key);

        for(Map.Entry<Integer,PointInfoDo> entry:pointInfoSchedulerMap.entrySet()){
            entry.getValue().cllisionMap.remove(key);
        }
    }

}
